home *** CD-ROM | disk | FTP | other *** search
- Path: EU.net!sun4nl!ittpub!ittpub!nntp
- Newsgroups: comp.lang.c++
- Subject: Re: Question about destructor...
- Message-ID: <1996Jan4.114938.1727@ittpub>
- From: wil@ittpub.nl (Wil Evers)
- Date: 4 Jan 96 11:49:38 WET
- References: <4ce9mk$atg@eng_ser1.erg.cuhk.hk>
- Distribution: world
- Nntp-Posting-Host: lintilla
-
- In article <4ce9mk$atg@eng_ser1.erg.cuhk.hk> ywleung@cs.cuhk.hk (Marty
- McFly) writes:
-
- > Dear All,
- >
- > I now have 2 classes A and B. B is a derived class of A.
- > However, the internal implementation of A is not known, i.e., the
- > private members of class A are not provided, only the public members are
- > given.
-
- That's interesting. As far as I know, there is no way to derive from a
- class if the compiler can't access its full declaration, including the
- private members. This is one of the more annoying limitations of C++, to
- say the least.
-
- > But class B is implemented by myself. So what should be written
- > in the destructor of B so that all the private members inherited from A
- > are also "deleted"?
-
- Nothing. After cleaning up the derived part of the object, a derived
- class's destructor automatically calls the base class destructor.
-
- - Wil
-